<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>
      <!-- v-if:让元素是否显示和变量进行绑定,true显示,false不显示(删除) -->
      <p v-if="isShow">刘德华</p>
      <p v-else>张学友</p>
      <!-- 需要频繁切换显示的元素可以使用v-show,作用与上面v-if一样 -->
      <p v-show="isShow">郭富城</p>
    </div>
  </body>
  <script src="./js/vue.min.js"></script>
  <script>
    let v = new Vue({
      el: "body>div",
      data: {
        isShow: true,
      },
      methods: {},
    });
  </script>
</html>
